﻿<!DOCTYPE html>
<html>

<head>
    <title>Cesium example</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <!-- CesiumUnminified -->
    <script src="https://openlayers.org/ol-cesium/node_modules/@camptocamp/cesium/Build/Cesium/Cesium.js"></script>
    <link rel="stylesheet" type="text/css"
        href="https://openlayers.org/ol-cesium/node_modules/@camptocamp/cesium/Build/Cesium/Widgets/widgets.css" />
    <style>
        html,
        body,
        #cesiumContainer {
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
            overflow: hidden;
        }
    </style>

</head>

<body>
    <div id="cesiumContainer"></div>
    <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script>
    <script src="../../build/mapv.js"></script>
    <script>
        var viewer = new Cesium.Viewer('cesiumContainer', {
            imageryProvider: new Cesium.UrlTemplateImageryProvider({
                url: 'http://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png',
                subdomains: ['a', 'b', 'c', 'd', 'e'],
            }),
        })
        viewer.camera.setView({
            destination: Cesium.Cartesian3.fromDegrees(118.403, 32.928, 5000000)
        });
        $.get('../data/beijing-village.json', function (data) {

            var dataSet = new mapv.DataSet(data);

            var options = {
                fillStyle: 'rgba(255, 80, 53, 0.8)',
                strokeStyle: 'rgba(250, 255, 53, 0.8)',
                context: 'webgl',
                size: 3,
                lineWidth: 1,
                draw: 'simple'
            }

            var mapvLayer = mapv.cesiumMapLayer(viewer, dataSet, options);
        });
    </script>
</body>

</html>